function myPostAjax(url,data,success){
    $.ajax({
        url:url,
        async: true,
        data: JSON.stringify(data),
        type: 'post',
        dataType: 'json',
        contentType:'application/json',
        success: function (respVo) {
                success(respVo)
        }
    });
}
function myGetAjax(url,data,resultMethod1) {
    $.ajax({
        url:url,
        async: true,
        data: data,
        type: 'get',
        dataType: 'json',
        success: function (respVo) {
            resultMethod1(respVo)
        }
    });
}
function logout() {
    myGetAjax(
        "/catering_system_app/user/logout",
        {
        },
        mylogout
    )
}
function mylogout(respVo) {
    if (respVo.code=="200"){
        $.cookie("username","");
        $.cookie("id","");
        location.href="index.html"
    }
}
function listname() {
    $(document).ready(function () {
        if ($.cookie("username") != null) {
            var split = $.cookie("username");
            $(".login:eq(0)").text(split);
            $(".login:eq(0)").attr("href", "#")
            $(".login:eq(0)").attr("target", "")
        } else {
            $(".login:eq(0)").attr("target", "_blank")
        }
    });
}